The LOCO-I loss-less compression algorithm for still images has been accepted for JPEG-LS standardization, and is applied for transferring pixel data relative to still images from a source device to a receiver device through a variety of media. The LOCO-I JPEG-LS algorithm is described in the following papers: M. J. Weinberger, G. Seroussi and G. Sapiro, “LOCO-I: A Low Complexity, Context Based, Loss-less Image Compression Algorithm”, Proc. of the 1996 Data Compression Conference (DCC '96), SnowBird, Utah, pp. 141–149, March 1996; and M. J. Weinberger, G. Seroussi and G. Sapiro, “The LOCO-I Loss-less Image Compression Algorithm: Principles And Standardization Into JPEG-LS”, IEEE Transactions on image processing, vol. 9 No. 8, pp. 1309–1324, August 2000.
A hardware implementation based on the LOCO-I algorithm, but modified to lower implementation complexity, is described in the article M. Klimesh, V. Stanton and D. Watola, “Hardware Implementation Of A Loss-less Image Compression Algorithm Using A Field Programmable Gate Array”, Feb. 15, 2001.
The basic LOCO-I algorithm is illustrated in FIG. 1. Each pixel is analyzed within its neighborhood or context window. The subsequent encoding of the circuit pixel is carried out according to either a Run-Length Mode if the context window is found to be substantially uniform in the grey level, or if this is not the case, the encoding follows a Regular Mode. This is according to which context table storing the history of the previous encodings of the pixels belonging to the context window is read for calculating a prediction value, and finally the difference between the circuit pixel and the calculated predicted value is encoded.
As may be noted from the scheme of FIG. 1, the context window for processing the current pixel Ix is defined to include the pixel Ra preceding the currently processed pixel Ix on the same row and the three neighboring pixels Rb, Rc and Rd belonging to the preceding row in terms of the standard sequence of scanning by rows of pixels of a two-dimensional object or image.
The hardware architecture of a standard JPEG-LS encoder/decoder implementing a loss-less compression algorithm, such as the LOCO-I, is shown in FIG. 2. The flow chart of the steps that are performed in a JPEG-LS LOCO-I encoder is detailed in FIG. 3, when the formation of the context window for a current pixel S to be processed that includes the last processed pixel A and the triplet of neighboring pixels CBD belonging to the preceding row that has already being scanned, is indicated.
As may be observed, after initialization, a sample Ix (pixel S of the context window), following the last processed sample (pixel A of the context window), is acquired. The computation starts with the calculation of local gradients: Q1=D−B; Q2=B−C; Q3=C−A relative to the acquired value Ix of the pixel S followed by the computation of the context value relative to the current pixel as a function of the calculated gradients: Co=f(Q1, Q2, Q3).
The result of the computation of the context value is compared with the threshold to determine whether the context value for the current pixel is either null or not null (i.e., significant). If the context value is found to be null, the Run-Length Mode encoding routine is performed, according to the sequence of steps specified in the box Run-Length Mode of the flow chart of FIG. 3.
Conversely, if the context value for the current pixel is found not to be significant, the Regular Mode encoding routine according to the sequence of steps specified in the box Regular Mode of the flow chart of FIG. 3 is performed for encoding the difference between the value Ix of the current pixel S and the calculated predicted value.
Apart from the provision, in the loss-less LOCO-I compressing algorithm presently being used, of the possibility of encoding relatively long sequences of pixels in a very efficient Run-Length Mode, as long as a substantial identity of progressively scanned pixels continues to be verified, the regular compression mode when a substantial identity of a newly scanned pixel with the preceding and neighboring one is no longer verified implements a pixel by pixel processing both in encoding as well as in decoding. As in any transfer of data, speed is of paramount importance.